<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Login/Register</title>
        <meta http-equiv="refresh" content="#{session.maxInactiveInterval};url=index.xhtml"/>
    </h:head>
    <body>
        <h:form>
            <table valign="center">
                <tr>
                    <td>
            <h:panelGrid>
                <h:outputText id="errorMessage"
                              value="#{loginBean.errorText}"/>
                Login:
                <h:inputText value="#{loginBean.login}"/>
                Password:
                <h:inputSecret value="#{loginBean.password}"/>
                <h:commandButton id="loginButton" 
                                 value="#{loginBean.buttonValue}"
                                 action="#{loginBean.onButtonClick()}"/>
            </h:panelGrid>
                    </td>
                    <td>
                    <h:selectBooleanCheckbox value="#{loginBean.register}"
                                             valueChangeListener="#{loginBean.change()}">
                        Register
                        <f:ajax execute="@this"
                                render="loginButton"/>
                    </h:selectBooleanCheckbox>
                    </td>
                </tr>
            </table>
        </h:form>
    </body>
</html>
